package com.ruoyi.boss.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.boss.mapper.TCarLevelMapper;
import com.ruoyi.boss.domain.TCarLevel;
import com.ruoyi.boss.service.ITCarLevelService;

/**
 * 车辆等级Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-17
 */
@Service
public class TCarLevelServiceImpl implements ITCarLevelService 
{
    @Autowired
    private TCarLevelMapper tCarLevelMapper;

    /**
     * 查询车辆等级
     * 
     * @param levelId 车辆等级主键
     * @return 车辆等级
     */
    @Override
    public TCarLevel selectTCarLevelByLevelId(Long levelId)
    {
        return tCarLevelMapper.selectTCarLevelByLevelId(levelId);
    }

    /**
     * 查询车辆等级列表
     * 
     * @param tCarLevel 车辆等级
     * @return 车辆等级
     */
    @Override
    public List<TCarLevel> selectTCarLevelList(TCarLevel tCarLevel)
    {
        return tCarLevelMapper.selectTCarLevelList(tCarLevel);
    }

    /**
     * 新增车辆等级
     * 
     * @param tCarLevel 车辆等级
     * @return 结果
     */
    @Override
    public int insertTCarLevel(TCarLevel tCarLevel)
    {
        tCarLevel.setCreateTime(DateUtils.getNowDate());
        return tCarLevelMapper.insertTCarLevel(tCarLevel);
    }

    /**
     * 修改车辆等级
     * 
     * @param tCarLevel 车辆等级
     * @return 结果
     */
    @Override
    public int updateTCarLevel(TCarLevel tCarLevel)
    {
        tCarLevel.setUpdateTime(DateUtils.getNowDate());
        return tCarLevelMapper.updateTCarLevel(tCarLevel);
    }

    /**
     * 批量删除车辆等级
     * 
     * @param levelIds 需要删除的车辆等级主键
     * @return 结果
     */
    @Override
    public int deleteTCarLevelByLevelIds(Long[] levelIds)
    {
        return tCarLevelMapper.deleteTCarLevelByLevelIds(levelIds);
    }

    /**
     * 删除车辆等级信息
     * 
     * @param levelId 车辆等级主键
     * @return 结果
     */
    @Override
    public int deleteTCarLevelByLevelId(Long levelId)
    {
        return tCarLevelMapper.deleteTCarLevelByLevelId(levelId);
    }
}
